package com.ruoyi.purchase.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchaseExecutionItemMapper;
import com.ruoyi.purchase.domain.PurchaseExecutionItem;
import com.ruoyi.purchase.service.IPurchaseExecutionItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购订单执行明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class PurchaseExecutionItemServiceImpl implements IPurchaseExecutionItemService 
{
    @Autowired
    private PurchaseExecutionItemMapper purchaseExecutionItemMapper;

    /**
     * 查询采购订单执行明细
     * 
     * @param executionItemId 采购订单执行明细主键
     * @return 采购订单执行明细
     */
    @Override
    public PurchaseExecutionItem selectPurchaseExecutionItemByExecutionItemId(Long executionItemId)
    {
        return purchaseExecutionItemMapper.selectPurchaseExecutionItemByExecutionItemId(executionItemId);
    }

    /**
     * 查询采购订单执行明细列表
     * 
     * @param purchaseExecutionItem 采购订单执行明细
     * @return 采购订单执行明细
     */
    @Override
    public List<PurchaseExecutionItem> selectPurchaseExecutionItemList(PurchaseExecutionItem purchaseExecutionItem)
    {
        return purchaseExecutionItemMapper.selectPurchaseExecutionItemList(purchaseExecutionItem);
    }

    /**
     * 新增采购订单执行明细
     * 
     * @param purchaseExecutionItem 采购订单执行明细
     * @return 结果
     */
    @Override
    public int insertPurchaseExecutionItem(PurchaseExecutionItem purchaseExecutionItem)
    {
        return purchaseExecutionItemMapper.insertPurchaseExecutionItem(purchaseExecutionItem);
    }

    /**
     * 修改采购订单执行明细
     * 
     * @param purchaseExecutionItem 采购订单执行明细
     * @return 结果
     */
    @Override
    public int updatePurchaseExecutionItem(PurchaseExecutionItem purchaseExecutionItem)
    {
        return purchaseExecutionItemMapper.updatePurchaseExecutionItem(purchaseExecutionItem);
    }

    /**
     * 批量删除采购订单执行明细
     * 
     * @param executionItemIds 需要删除的采购订单执行明细主键
     * @return 结果
     */
    @Override
    public int deletePurchaseExecutionItemByExecutionItemIds(String executionItemIds)
    {
        return purchaseExecutionItemMapper.deletePurchaseExecutionItemByExecutionItemIds(Convert.toStrArray(executionItemIds));
    }

    /**
     * 删除采购订单执行明细信息
     * 
     * @param executionItemId 采购订单执行明细主键
     * @return 结果
     */
    @Override
    public int deletePurchaseExecutionItemByExecutionItemId(Long executionItemId)
    {
        return purchaseExecutionItemMapper.deletePurchaseExecutionItemByExecutionItemId(executionItemId);
    }
}
